package structural;

import java.util.Stack;

import pusher.Grid;

public class TreeNode {
	
	private Stack<TreeNode> children;
	private Grid grid;
	private int move;
	
	public TreeNode(){
		this.children = new Stack<TreeNode>();
		this.grid = null;
	}
	
	public TreeNode(Grid grid){
		this.children = new Stack<TreeNode>();
		this.grid = grid;
	}
	
	public int getMove() {
		return move;
	}

	public void setMove(int move) {
		this.move = move;
	}
	
	public void addChild(TreeNode node){
		this.children.push(node);
	}
	
	public int size(){
		return children.size();
	}
	
	public TreeNode getChild(int index){
		return this.children.get(index);
	}
	
	public Grid getGrid(){
		return this.grid;
	}
	
	public void removeGrid(){
		grid = null;
	}
	
	public void removeReference(){
		grid = grid.clone();
	}
	
}
